UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1csUqmpFDCwo8c8ZbPiVle35jWcc8Ahlha1aY3/VmCc='
WHERE
key_id = '3e3f5275ab2b3522d67464bcca16fe0fbff599de2f8837c907fdd4cfa0c51c27'
AND (
token = '1csUqmpFDCwo8c8ZbPiVle35jWcc8Ahlha1aY3/VmCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)