UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uC+9P4aQM68/GPw/sWT1xoQS+Vt5FOKb3+9Q07wJBIg=' 
WHERE 
  key_id = 'be13af4e4d6d0ba8e93d3c7921dffe34662deda1302a42e9f52f680c421704d1' 
  AND (
    token = 'uC+9P4aQM68/GPw/sWT1xoQS+Vt5FOKb3+9Q07wJBIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044