UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IDN5lhqnoVTuIwvBZKnTKWj3b3k3rZ5XHg1TPB1mMqY='
WHERE
key_id = '3f86bfdd88c3f181f2741498f669fd5c0c60ec0cc3e56e0fd5d74979cb32ea87'
AND (
token = 'IDN5lhqnoVTuIwvBZKnTKWj3b3k3rZ5XHg1TPB1mMqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)