UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U+K4bevSM+zD1cd3LTLzhS/Vg3awtja6Gk272FaQMF0='
WHERE
key_id = 'be57e5b24eebbbc33b4a1e811632b6520d3ff08c620de0419e1bfeca49770ae3'
AND (
token = 'U+K4bevSM+zD1cd3LTLzhS/Vg3awtja6Gk272FaQMF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)