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