UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BwYGFqZ8C03kaDrLUNj/jV+svb+ZEt4cT8MRG/bbbhg=' 
WHERE 
  key_id = 'cc2bcd3a1e020d07a538c3c954114bd3de8e5a92cc5a2f85383cfcf0da2d2c85' 
  AND (
    token = 'BwYGFqZ8C03kaDrLUNj/jV+svb+ZEt4cT8MRG/bbbhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029