UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0M6x1AZsbb/OEu+L7XhX8a702+l2CIYMbmQQuFKVX9Q='
WHERE
key_id = 'cb6d2ed1f15fb9e1b4c3ad40ba523a52650f6b667f930d848035d6526a92f2d3'
AND (
token = '0M6x1AZsbb/OEu+L7XhX8a702+l2CIYMbmQQuFKVX9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)