UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K4CnZcIdmia2aBLmscExMOHVpCwxkxiwal27elvuB4s='
WHERE
key_id = 'd8442186a73a6cd00085439084601d79cfe804a75bf0ede1594985be7c7c76dc'
AND (
token = 'K4CnZcIdmia2aBLmscExMOHVpCwxkxiwal27elvuB4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)