UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+DJGakTvhTIgS9cQKuxzBE9Uyo9PkcZvKDnnyr6LHqg='
WHERE
key_id = '24df6d83dfca1d0dc393ffa6fdea63039092b0afcbe99cf771049ac38d7c5a7e'
AND (
token = '+DJGakTvhTIgS9cQKuxzBE9Uyo9PkcZvKDnnyr6LHqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)