UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p6UvjFWIgnO9aYzjTLF8U9XEj47mFuqDit/D85xdZTc='
WHERE
key_id = '34f14e3bde4f4971a12b615d60c9bf6f9c08a5a5186c6ccbb07d41dcf3723a42'
AND (
token = 'p6UvjFWIgnO9aYzjTLF8U9XEj47mFuqDit/D85xdZTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)