UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xw2fI66vcXHGNSACXXYqirtaHMPQMh4DNoDvQbgF/9o='
WHERE
key_id = '561a229395d81f1fe842aa4a0d98f302e88b6c58804982367986bf4e3dd1aa8d'
AND (
token = 'xw2fI66vcXHGNSACXXYqirtaHMPQMh4DNoDvQbgF/9o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)