UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j1Uaf23Wj5chvQU4++RqlIoByWt7ZAK8Z8lYx2KuHVU=' 
WHERE 
  key_id = '99d5e98cfc0c57b7e845059fbd5b7bd9962b8ffbde803757024e0efbd90a6cfd' 
  AND (
    token = 'j1Uaf23Wj5chvQU4++RqlIoByWt7ZAK8Z8lYx2KuHVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028