UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M5zuDgagc2zzXbAjbpB4s3iw2/S8KfzL7OGH96XovgE='
WHERE
key_id = 'a192fa9e7425250db539476b45c93fda78ff36e16bac0e6b558dc8e65da01388'
AND (
token = 'M5zuDgagc2zzXbAjbpB4s3iw2/S8KfzL7OGH96XovgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)