UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2EGO3AVHO+a+gvT8dAVcUWDt0QJ0+QpTMmxXMctpC5Y='
WHERE
key_id = '7593f5af3b745b8f0c5c88b612d486ac21af9f2b1b9e1acedef32fc0ffc981cb'
AND (
token = '2EGO3AVHO+a+gvT8dAVcUWDt0QJ0+QpTMmxXMctpC5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)