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