UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F7jEuQp57UYdxInMHWXUn07emsGEjuFqdMH2YnGESD8='
WHERE
key_id = 'b30a11b5bc6c104362d6695e955b958b5ad437a9e0923ee4142cbf7fc99ef86f'
AND (
token = 'F7jEuQp57UYdxInMHWXUn07emsGEjuFqdMH2YnGESD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)