UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iGG30U6PcEUMV9sRMzMl7IqQ2nh8H90mWVw7d0u92DA='
WHERE
key_id = '80d7db86774fbec606381976e5596cd208ad9f9cd55ed97b8510bf14dcf82250'
AND (
token = 'iGG30U6PcEUMV9sRMzMl7IqQ2nh8H90mWVw7d0u92DA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)