UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y+AN/VyA6dFwOT3cxwkQreHTnzKbr2ENLONvf1vb0AE='
WHERE
key_id = '47c5419ed4a13da434ca2baad34dfa8f9669eaba6d1c533fef2cc88dfd1724aa'
AND (
token = 'y+AN/VyA6dFwOT3cxwkQreHTnzKbr2ENLONvf1vb0AE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)