UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rz/8cntPMJGj+omU75RvMnJf39g3qDbbQO0lQjvzA64=' 
WHERE 
  key_id = 'febfd3aa9cf097722a6b80174fb6de12dca669af2576715a83a05919fdae5586' 
  AND (
    token = 'rz/8cntPMJGj+omU75RvMnJf39g3qDbbQO0lQjvzA64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029