UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'syMtworHeo84mAI81MZ2RNGGQ3ezAgr1IPiP4Gtvbto='
WHERE
key_id = '00966f01f8d3095b81300cc0f58f4bdc28bbc439a8d0ba03644d6831bc681caa'
AND (
token = 'syMtworHeo84mAI81MZ2RNGGQ3ezAgr1IPiP4Gtvbto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)