UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LNci8flN4cS3U9nQX4iFi6JKFEL2YHtiVJ82t25KBYg='
WHERE
key_id = '08a6068a329bfadbefa59681a88ec65e43e4b8bf3ead344023761a07bbbc4df9'
AND (
token = 'LNci8flN4cS3U9nQX4iFi6JKFEL2YHtiVJ82t25KBYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)