UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K/rqojJk2ScsOb4CwYvi+6La7aFSrPYB9YgWd7L5ZCo='
WHERE
key_id = 'd17309409a1397f485a3b87a3a23d82048fbe75061c14ffaa38edd8c5d413a45'
AND (
token = 'K/rqojJk2ScsOb4CwYvi+6La7aFSrPYB9YgWd7L5ZCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)