UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2QY8gohkh8cmiHF04gJ0C0zHl1s+HdJ6mWsnHbo5myM='
WHERE
key_id = '4520faf798f70a38dad73f8eb1a89525a2da218c6bbabe7dc8619c1994e4bee5'
AND (
token = '2QY8gohkh8cmiHF04gJ0C0zHl1s+HdJ6mWsnHbo5myM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)