UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5cVXqA8t7V/PSe9WH0g2xTlbBwwxiP1GXcYFUgv8hjY='
WHERE
key_id = 'd6656d0b9a6025605cc176f1ca9cdb6e4af328bcb834a7a52ede372b82552140'
AND (
token = '5cVXqA8t7V/PSe9WH0g2xTlbBwwxiP1GXcYFUgv8hjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)