UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '55wanQUohpqdP3zXCJLVe1gKAp8AZZSDu9sxCmy4BbY='
WHERE
key_id = '2b173dbb7ba1c92c5a1d5b35063bf760a9781e0938e6ebab52a8a4b1319e07eb'
AND (
token = '55wanQUohpqdP3zXCJLVe1gKAp8AZZSDu9sxCmy4BbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)