UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/pgYYhE9MNYOFxim99RG3XPfBMDhgEKp8nhTH+PLPSI='
WHERE
key_id = 'a2c670110264bf0018c96874f165d82e584c290733849974ee0db6223957c646'
AND (
token = '/pgYYhE9MNYOFxim99RG3XPfBMDhgEKp8nhTH+PLPSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)