UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bSIu5b42s0L37ubEZTZpRGfCJ3JIo1Iw20XWkLEJNFo='
WHERE
key_id = '64b16ae132f95c4d841b41ce44864438a054c0a7d2233448498537263ffba5f0'
AND (
token = 'bSIu5b42s0L37ubEZTZpRGfCJ3JIo1Iw20XWkLEJNFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)