UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5uzx+Ovj11NthIubr+Mi5UwVI6CVUBkpc4MfXxNPiFk='
WHERE
key_id = 'c891433b5a14fe9706441d3d6270f260396fb675e50d0900b18d71e7c3862726'
AND (
token = '5uzx+Ovj11NthIubr+Mi5UwVI6CVUBkpc4MfXxNPiFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)